package com.miniserver.tql.database.impl;

import com.miniserver.tql.database.DatabaseEngine;

public class OracleEngineImpl extends DatabaseEngineBaseImpl implements DatabaseEngine {
	public OracleEngineImpl() {		
	}

	/**
	 * 构造 Oracle数据分页SQL
	 * 
	 * @param queryString
	 * @param startIndex
	 * @param pageSize
	 * @return
	 */
	@Override
	protected String getPageSQL(String queryString, Integer pageSize, Integer pageIndex) {
		int endIndex = pageIndex * pageSize;
		String endSql = "select * from (select rOraclePageSQL.*,ROWNUM as currentRow from (" + queryString
				+ ") rOraclePageSQL where rownum <" + endIndex + ") where currentRow>" + (pageIndex - 1) * pageSize;
		return endSql;
	}
}
